import React from 'react';
import { Table } from 'antd';
import Utils from '@/components/Engineering/utils';

export default class Localfees extends React.Component {
  state = {};
  page = {};
  columns = [
    {
      title: '费用名称(代码)',
      dataIndex: 'changxian',
      key: 'chuanxian',
      render: (text: any, record: any) => (
        <div>
          {record.name}({record.code})
        </div>
      ),
    },
    {
      title: '单位',
      dataIndex: 'unit',
      key: 'unit',
      render: text => {
        return { '1': '箱', '2': '票' }[text] || '未知';
      },
    },
    { title: '20GP', dataIndex: 'fee20gp', key: 'fee20gp' },
    { title: '40GP', dataIndex: 'fee40gp', key: 'fee40gp' },
    { title: '40HP', dataIndex: 'fee40hq', key: 'fee40hq' },
    { title: '单票价格', dataIndex: 'feeSingle', key: 'feeSingle' },
    { title: '币种', dataIndex: 'currency', key: 'currency' },
  ];

  render() {
    const { localfeesData } = this.props;
    return (
      <Table
        columns={this.columns}
        dataSource={localfeesData}
        size="small"
        pagination={localfeesData.page ? true : false}
      />
    );
  }
}
